/* vector 数据存取操作 */
#include <iostream>
#include <vector>
using namespace std;

void my_print(vector<char> v);
int main(int argc, char **argv)
{
    char arr[] = "kashjgfka";
    vector<char> v(arr, arr + sizeof(arr) / sizeof(arr[0]));


    cout << v[7] << endl;
    cout << v.at(7) << endl;
    v.at(7) = 'K';
    my_print(v);

    cout << v.front() << endl;
    cout << v.back() << endl;




    return 0;

}

void my_print(vector<char> v)
{   
    vector<char>::iterator it = v.begin();

    for (; it != v.end(); it++)
    {
        cout << *it << " ";
    } /* end of for (; it != v.end(); it++) */
    cout << endl;

    return;
}